<?php
header('content-type:text/html;charset=utf8');

$cname=$_POST['cname'];
$describe=$_POST['describe'];
$status=$_POST['status'];
$datetime=$_POST['datetime'];
//var_dump($status);die;

$link =@mysql_connect('127.0.0.1','root','root');
if(!$link){
    die('连接失败，错误号为：'.mysql_errno().'失败原因：'.mysql_error());
}
mysql_select_db('blog');
mysql_set_charset('utf8');
$sql = "insert into `column`(`cname`,`describe`,`status`,`datetime`) values('$cname','$describe','$status','datetime')";

$res = mysql_query($sql) or mysql_error();



if($res){
    echo '<script>alert("新增成功");window.location.href="/admin/column/index.php"</script>';
}else{
    echo '<script>alert("新增失败");window.location.href="/admin/column/index.php"</script>';
}
mysql_close();
?>